{% extends "base.html" %}
{% load i18n %}
{% block head_title %} {% trans "view technology" %} {% endblock %}

{% block center_area %}

<head>
    <style type="text/css">

        .report {font-size: 85%;
                width:200%;
                margin: 0 auto; 
                
                }
        
        td      {
                text-align:center;

                }
        table{
                border-collapse:collapse;
            }
    </style>
</head>

<div class="report">
<div id="verification"></div>
    <a id='technology_list' class="btn btn-primary active" value="TechnologyList" href="{% url technologies_list %}">{% trans 'technology list' %}</a>
<table class="table table-bordered" cellpadding ="0">
<tr>
    <td colspan='3' >
        <table class="table table-bordered" >
            <tr>
                <td colspan='2' rowspan="2">康春机械</td>
                <td colspan='4' rowspan="2">机械加工工艺过程卡</td>
                <td colspan='2'>产品代号</td>
                <td colspan='2'>图号</td>
                <td colspan='2'>零、部、组(整体)件名称</td>
                <td>工艺文件编号</td>
                <td >发放号</td>
            </tr>

            <tr class="">
                <td colspan='2'>{{ technology.product.symbol }}</td>
                <td colspan='2'>{{ technology.product.cad_code }}</td>
                <td colspan='2'>{{ technology.product.name }}</td>
                <td>{{ technology.file_code }}</td>
                <td>{{ technology.publish_code }}</td>
            </tr>

            <tr>
                <td colspan='3' align="center">零件数量</td>
                <td colspan='2' align="center">零件质量</td>
                <td colspan='4' align="center">材料</td>
                <td colspan='5' align="center">毛坯</td>
            </tr>

            <tr>
                <td>每个产品</td>
                <td>备件</td>
                <td>总计</td>
                <td>单件</td>
                <td>全套</td>
                <td>牌号</td>
                <td>标准代号</td>
                <td>硬度</td>
                <td>种类</td>
                <td>剖面尺寸</td>
                <td>长度</td>
                <td>数量</td>
                <td>单件质量kg</td>
                <td>全套质量kg</td>
            </tr>

            <tr>
                <td>{{ technology.each_product|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.spare_part|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.total|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.one_piece|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.complete_set|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_mark|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_standard_code|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_hardness|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_species|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_sectional_dimensions|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_length|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_quantity|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_single_weight_kg|default_if_none:"&nbsp;" }}</td>
                <td>{{ technology.workblank_full_weight_kg|default_if_none:"&nbsp;" }}</td>
            </tr>

        </table>
    </td>
<tr/>
<tr>
    <td>
    <table id="operation_groups" class="table table-bordered">
        <thead>
            <tr>
                <td>工序号</td>
                <td>工种</td>
                <td>工序名称</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody id="OG_body">
        {% for operation_group in technology.operation_groups.all %}
            <tr>
                <td class="col-md-1">{{ operation_group.order|default_if_none:"&nbsp;" }}</td>
                <td class="col-md-4">{{ operation_group.Job.position.name|default_if_none:"&nbsp;" }}</td>
                <td class="col-md-6">{{ operation_group.name|default_if_none:"&nbsp;" }}</td>
                <td class="col-md-1">
                {% if operation_group.operations.all %}
                    <a name="view-row" href="{% url view_operation_group operation_group.id %}">{% trans 'view' %}</a>
                    {% if technology.technology_workflow_status != 2 and not technology.technology_workflow_approved %}
                    <a name="edit-row" href="{% url edit_operation_group operation_group.id %}">{% trans 'Edit' %}</a>
                    {% endif %}
                {% else %}
                    <a name="create-row" href="{% url create_operation_group operation_group.id %}">{% trans 'Create' %}</a>
                {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    </td>
<tr/>
<tr>
    <td colspan="3">
    <table class="table table-bordered">
        <tr>
            <td>描图</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>阶段标记</td>
        </tr>

        <tr>
            <td rowspan='2'>描较</td>
            <td rowspan='2'></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>编制</td>
            <td>审核</td>
            <td>标准化</td>
            <td>会签</td>
            <td>批准</td>
            <td></td>
        </tr>

        <tr>
            <td>&nbsp;</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>{{ technology.bianzhi.executor.last_name }}{{ technology.bianzhi.executor.first_name }}</td>
            <td>{{ technology.shenhe.executor.last_name }}{{ technology.shenhe.executor.first_name }}</td>
            <td>{{ technology.biaozhunhua.executor.last_name }}{{ technology.biaozhunhua.executor.first_name }}</td>
            <td>{{ technology.huiqian.executor.last_name }}{{ technology.huiqian.executor.first_name }}</td>
            <td>{{ technology.pizhun.executor.last_name }}{{ technology.pizhun.executor.first_name }}</td>
            <td></td>
        </tr>

        <tr>
            <td></td>
            <td>更改标记</td>
            <td>更改单号</td>
            <td>签名</td>
            <td>日期</td>
            <td>更改标记</td>
            <td>更改单号</td>
            <td>签名</td>
            <td>日期</td>
            <td>{{ technology.bianzhi.date_added.date|date:"Y-m-d" }}</td>
            <td>{{ technology.shenhe.date_added.date|date:"Y-m-d" }}</td>
            <td>{{ technology.biaozhunhua.date_added.date|date:"Y-m-d" }}</td>
            <td>{{ technology.huiqian.date_added.date|date:"Y-m-d" }}</td>
            <td>{{ technology.pizhun.date_added.date|date:"Y-m-d" }}</td>
            <td></td>
        </tr>

    </table>
</td>
</tr>
</table>
{% if technology.technology_workflow_status != 2 and not technology.technology_workflow_approved %}
    <a id='edit' class="pull-right btn btn-primary active" value="Edit" href="{% url edit_technology technology.id %}">{% trans 'Edit' %}</a>
{% endif %}
</div>

{% endblock %}
